package com.swinboo.im.converter;

import com.alibaba.fastjson.JSON;
import com.huang.base.core.BaseConvertor;
import com.swinboo.im.entity.info.ChatRecordInfo;
import com.swinboo.im.entity.repository.ChatRecord;
import org.springframework.stereotype.Component;

/**
 * @author Swinboo
 * @date 2022-03-21 16:48
 * @description:
 */

@Component
public class ChatRecord2ChatRecordInfo extends BaseConvertor<ChatRecord, ChatRecordInfo> {
    @Override
    public ChatRecordInfo doConvert(ChatRecord chatRecord) {
        return JSON.parseObject(JSON.toJSONString(chatRecord),
                ChatRecordInfo.class);
    }
}
